package com.pw.ba.base.controller;

import com.pw.ba.base.pojo.GoodsDetail;
import com.pw.ba.base.service.GoodsDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/goods")
public class GoodsDetailController {

    @Autowired
    GoodsDetailService goodsDetailService;

    @GetMapping("/goodsDetailById")
    public List TopTabsList(String cid){
        int id = Integer.valueOf(cid);
        List<GoodsDetail> goodsDetails = goodsDetailService.goodsDetailById(id);

        return goodsDetails;
    }

    @GetMapping("/goodsDetail")
    public List TopTabsList(){
        List<GoodsDetail> goodsDetails = goodsDetailService.goodsDetail();
        return goodsDetails;
    }

}
